# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Thomas Baechler <thomas@archlinux.org>

pkgbase=thunderbird-i18n
pkgver=60.0
pkgrel=2
pkgdesc="Language pack for Thunderbird"
arch=('any')
url="http://www.mozilla.com/"
license=('MPL' 'GPL')

_languages=(
  'ar     "Arabic"'
  'ast    "Asturian"'
  'be     "Belarusian"'
  'bg     "Bulgarian"'
  'br     "Breton"'
  'ca     "Catalan"'
  'cs     "Czech"'
  'cy     "Welsh"'
  'da     "Danish"'
  'de     "German"'
  'dsb    "Lower Sorbian"'
  'el     "Greek"'
  'en-GB  "English (British)"'
  'en-US  "English (US)"'
  'es-AR  "Spanish (Argentina)"'
  'es-ES  "Spanish (Spain)"'
  'et     "Estonian"'
  'eu     "Basque"'
  'fi     "Finnish"'
  'fr     "French"'
  'fy-NL  "Frisian"'
  'ga-IE  "Irish"'
  'gd     "Gaelic (Scotland)"'
  'gl     "Galician"'
  'he     "Hebrew"'
  'hr     "Croatian"'
  'hsb    "Upper Sorbian"'
  'hu     "Hungarian"'
  'hy-AM  "Armenian"'
  'id     "Indonesian"'
  'is     "Icelandic"'
  'it     "Italian"'
  'ja     "Japanese"'
  'ko     "Korean"'
  'lt     "Lithuanian"'
  'nb-NO  "Norwegian (Bokmål)"'
  'nl     "Dutch"'
  'nn-NO  "Norwegian (Nynorsk)"'
  'pl     "Polish"'
  'pt-BR  "Portuguese (Brazilian)"'
  'pt-PT  "Portuguese (Portugal)"'
  'rm     "Romansh"'
  'ro     "Romanian"'
  'ru     "Russian"'
  'si     "Sinhala"'
  'sk     "Slovak"'
  'sl     "Slovenian"'
  'sq     "Albanian"'
  'sr     "Serbian"'
  'sv-SE  "Swedish"'
  'tr     "Turkish"'
  'uk     "Ukrainian"'
  'vi     "Vietnamese"'
  'zh-CN  "Chinese (Simplified)"'
  'zh-TW  "Chinese (Traditional)"'
)

pkgname=()
source=()
_url=https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/$pkgver/linux-x86_64/xpi

for _lang in "${_languages[@]}"; do
  _locale=${_lang%% *}
  _pkgname=thunderbird-i18n-${_locale,,}

  pkgname+=($_pkgname)
  source+=("thunderbird-i18n-$pkgver-$_locale.xpi::$_url/$_locale.xpi")
  eval "package_$_pkgname() {
    _package $_lang
  }"
done

# Don't extract anything
noextract=(${source[@]%%::*})

_package() {
  pkgdesc="$2 language pack for Thunderbird"
  depends=("thunderbird>=$pkgver")
  install -Dm644 thunderbird-i18n-$pkgver-$1.xpi \
    "$pkgdir/usr/lib/thunderbird/extensions/langpack-$1@thunderbird.mozilla.org.xpi"
}

sha256sums=('782066f815ee65cbc6984bd64855c71e7c625f19d456b9153e5ac9361ce2dbac'
            '097a7f1632d1e701891423876af06e9b2474584661d618352fc47cc137a90a4b'
            '66e701e8d6505c42aed613f78de84e19f08a9b3a99143c6206094756009628b0'
            'bcf46ba1484d442d821e812d49eafd2f6c2616604e930585234454eda579aff1'
            '749b91a82cb4eba11887b89e0a8143e49b4ad05aa7757441eca2ab9552444a52'
            'bb95ded8f696e47c55b9734aa0635c21d645db229fccfdb10282e57f4ace1fe1'
            'dc7256dce7b23528c3d6cf02bab89037e65593e142ca4cb8f574afa6884593a4'
            '96551f70f1e026c14fa04f8bd868f5a7e5ad5b6667a6d482f94fa934a5bc40a1'
            '0d009a143331305d475cc3cd494f8270dab3aebc66c836296beee0873a66b494'
            '0e03e79c6eb6a4be604825c86376cabce050a00f84c03264bfac417bc320bdfb'
            'a2ee9e48e97e83741454ffdf96bb7cfd31721422ff1f16216e26885292ac0b29'
            '50309bab799d60c95ac43d3383bdae06f7e2a563241743adf130f449bcde3150'
            'b2d7466e287a5c8eb0e49c2dca5497f0fc8763d79c5541abdf8c77f6cbfb3d81'
            '549f74b5c01f2b1c731b144fedb95a7bbe5748e8bae018439cf1b55c079f2ff4'
            'd2fc146fc036c672c7d12ddfe90d7446e0c18556480a17a966d8ce39951227f8'
            '98d82eda7a4a3a4e7eb7495e939ad82dc9b53a01866e93ad5f648dd06126fd17'
            'ef18fb04c4fe849d7f5685e15aba69db614f11c32dfeaccae9cab9dbbcce0927'
            '5d00497f10b000c8739a25520d02e2612f89d7b7b73b4515f1b956fdfc8a0358'
            '765064373cf2cf2bbe0913eef27353e536af912f38009d0932b20cfd9aa2df04'
            '9765224e7ca9d130abb4c82eee8b9a0aca8f77b4f93d12556aa8e8ed054a3aab'
            '640fddfd90b10e444d2d1c0566c9fe5abf68ed810836663a073e673038a1bfe3'
            '8fc908661bd403b7f9e0273339ea1cf73402cb88abe40cf3080fb9fbbaecb896'
            '0e94e72a16dd8cabe1edd2202effc05541488d40fe2dd79cd6933de8b0af9b6f'
            'dc4fe160e7ec2c58261636a06e39e40f019de3fae57c977b6a3fd1edad86c64f'
            '6d9511733d081383f2651e8ab10d819892960a9657cf56109309db72fbd3e86d'
            '03beb1cf7bb9f50cad093b09ad70a2ec64ee0dd4d980ed449ff0d625cdbe5ddf'
            '7a49eabab067b9b7bd9ff0e646803759149021f2e0e13d37a4a42970563fcafc'
            '0f51d80b0b15b8ab5e6cca5b84530e6da9f8cf69f3a3026b838f4265ec3893c4'
            'e655d59dfac3d1f7930a65e3236e70cdd3577b3506dffa0460d57e26d57c3e61'
            '9e5cc84bc4b5a43ec50c15a3ef513fef24d564653a8a7cfd0020bf6bc5be40cd'
            'e81ef7bece622d734f67893472660ad40dc28503011979063623066b58e792d9'
            '3cb0d809c41ab096058c87a18235b06e031608fdf32d8758970aa490f553019c'
            'd3c55915a6872f81144a57439be7a0625771e17f45b73bddba008d0a6a7032de'
            '804fddde57a4b8db0e2a21ba8931543daaeee81fe27482aa299004352b444d4c'
            '9ed53901d3589f542b06406332a1478b5dd378e34ccbc63195d3dac0040c3a25'
            '563e9f8f6b6d471fc19c53ae0f810d239c3fe7e3c337506c420c2989afb1c22d'
            '61ced037011c34544af7c57663b693320ca0a7fb590b40f68c13203bbc6320d5'
            '9e7a0b0c08cc0904e002f23237a0405fb9bb8c1db7f7399d94d2ee372ed72cbc'
            '9cb507d86d019e8023fa6b0b04d28c679f20db8b733407d9fcf92ccb10555f91'
            '50f23a5eddbd2e170cf00903e0cbf6fb0ffa52dc55ea02d2b141d4904ef7a0ba'
            '3021391b383a3809b3a66de3553b0e75cae78f87c4e5303c30b9864bda823e36'
            '7c1a7ddba15a4bf3b89e68dc8ca2dd5fc669899bec76d2570906ded57f184306'
            '8ac6a5e21a53507447f5122a19933b5773352046b79b94babfd126dabe90c4dc'
            '24c9ae3ad312785baa4c10e8e2280d80e44a060174f2d99d575c46b7e063e483'
            '04a5b6551eefa734e7b7f55627811694b90ea39b313dd812ac748ae12617ce1b'
            '11589c026e80d278aea96b1cd9340ecc4297841119135e73d0e5935d378eeab5'
            '43dc11f8340bf8661f31e485c321a005582487b684ddafbf88f9de798a29ed1f'
            '995ab184916ad470f53bef9736225e2c2413d9384c59ddb4cc4cbfff1f4b689c'
            '8a538a47a15f320567e56643c0120abaed3ab0536cdd2ddf9ae70c73809d1f11'
            '5dd538eb760792a6eac74b79cafe29181908b91ad8bfd825398b24cd3fb88783'
            '0dbbe8b2fbf9c1528d3b569cfc84da4344a20b3fce129a333c1792f620d565c8'
            'f4f5d92f130e6a7f13bdb02728490bb64720dfd3d48a7757487e4996a8496539'
            'cb057b7af5b0ab9f9bb253d9e431b0a11656eb30bd670fce22a1bdf6145bd48b'
            'ea07363d1363e44c0c55465a34d8d009fec92aab83ca5ef1259b7dbb6780e29b'
            'b15600749266bc94a45d68a814fa1ff99037201cb637d393254b798417c18b55')
